package com.openspring.business.dao.impl;

import java.util.List;
import org.springframework.stereotype.Repository;
import com.openspring.framework.dao.AbstractSpringGenericDAO;
import com.openspring.framework.extend.spring.EntityPropertyRowMapper;
import com.openspring.business.dao.EmployeeDAO;
import com.openspring.business.model.Employee;

@Repository("employeeDAO")
public class EmployeeDAOImpl extends AbstractSpringGenericDAO<Employee, Long> implements EmployeeDAO {

	@Override
	public List<Employee> query(Long deptId) {
		String sql = "SELECT * FROM emp.t_business_employee WHERE \"deptId\" = ?";
		return getJdbcTemplate().query(sql, new EntityPropertyRowMapper<Employee>(Employee.class), deptId);
	}
}
